package org.coody.gitee.fuzzer;

import org.coody.gitee.entity.GiteeEntity;
import org.coody.gitee.exception.FuzzerException;
import org.coody.gitee.fuzzer.iface.GiteeFuzzer;
import org.coody.gitee.util.HttpUtil;
import org.coody.gitee.util.HttpUtil.HttpEntity;

public class GiteeInitFuzzer extends GiteeFuzzer {

	@Override
	public void fuzzer(GiteeEntity giteeEntity) throws FuzzerException {
		String url = "https://gitee.com/signup";
		HttpEntity entity = HttpUtil.Get(url);
		giteeEntity.setCookie(entity.getCookie());
		String csrfToken = getCsrfToken(entity.getHtml());
		giteeEntity.setCsrfToken(csrfToken);
	}

}
